package com.ming.study.exceptionHandler;

import com.ming.study.utils.ResultCodeImpl;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("异常类")
public class MingException extends RuntimeException{
    @ApiModelProperty("异常码")
    private Integer code;
    private String msg;

    public MingException(ResultCodeImpl resultCode){
        this.code = resultCode.getCode();
        this.msg = resultCode.getMessage();
    };
}
